<template>
  <div class="login-container">
    <el-form class="login-form" :model="loginForm" :rules="loginRules">
      <div class="title-container">
        <h3 class="title">忘记密码</h3>
      </div>

      <el-form-item prop="username">
        <span class="svg-container">
          <svg-icon icon="user" />
        </span>
        <el-input
          placeholder="username"
          name="username"
          type="text"
          v-model="username"
        />
      </el-form-item>
    </el-form>
    <el-button @click="submit"> 找回密码</el-button>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { forget } from '@/api/login'
const username = ref('123')

function submit() {
  forget({
    username: username.value
  }).then((res) => {
    console.log(res)
    if (res.code === 200) {
      alert('邮件发送成功')
    }
  })
}
</script>
